const express = require('express');
const controller = require('@root/services/mo_upload.service.js');
const { body } = require("express-validator");

const router = express.Router();

router.post('/upload', controller.uploadMiddleware, controller.uploadFile);
router.get('/files', controller.getFiles);
router.get('/files/:id/download', controller.downloadFile);
router.delete(
  '/files', [
  body("ids").isArray({ min: 1 }).withMessage("ids必须是数组,且不能为空"),
], controller.deleteFile);

module.exports = router;